<?php
session_start();
header("Content-type: image/gif");
$im = @imagecreate(100, 20)
    or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 255, 255, 255);
$text_color = imagecolorallocate($im, 233, 14, 91);

$_SESSION['pin'] =  rand(1000,9999);

imagestring($im, 5, 0, 0, "".$_SESSION['pin'], $text_color);
imagepng($im);
imagedestroy($im);
?> 